<?php

namespace App\Http\Controllers;

use App\Library\Service\AlipayService;
use App\Library\Service\WechatService;
use App\Library\YsdLib;
use Psr\Http\Message\ResponseInterface;
use Yansongda\Artful\Exception\ContainerException;
use Yansongda\Artful\Exception\InvalidParamsException;
use Yansongda\Artful\Exception\ServiceNotFoundException;
use Yansongda\Pay\Pay;

class AlipayController extends BaseController
{
    /**
     * @throws ContainerException
     */
    public function __construct(AlipayService $service)
    {
        Pay::config(YsdLib::config());
        $this->service = $service;
    }

    /**
     * notify
     * @return ResponseInterface
     * @throws ContainerException
     * @throws InvalidParamsException
     */
    public function notify(): ResponseInterface
    {
        return $this->service->notify();
    }
}
